using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GameSetPanel : BasePanel
{
    private static string name = "GameSetPanel";
    private static string path = "UI/GameSetPanel";
    public static readonly UIType uIType = new UIType(name, path);

    public GameSetPanel() : base(uIType)
    {

    }

    public override void OnDestroy()
    {
        base.OnDestroy();
    }

    public override void OnDisable()
    {
        base.OnDisable();
    }

    public override void OnEnable()
    {
        base.OnEnable();
    }

    public override void OnStart()
    {
        base.OnStart();
        UIMethod.GetInstance().GetOrAddComponentInChild<Button>(ActiveObj, "Back").onClick.AddListener(Back);
        UIMethod.GetInstance().GetOrAddComponentInChild<Button>(ActiveObj, "Close").onClick.AddListener(Close);
    }
    private void Back()
    {
        GameRoot.GetInstance().SceneControl_Root.SetState(new StartScene());
    }
    private void Close()
    {
        GameRoot.GetInstance().UIManager_Root.Pop(false);
        Time.timeScale = 1;
    }
}
